import Request from '../utils/http';

// 获取订单列表
export function getOrderList() {
  return Request.get('/order/list');
}

// 获取单个订单数据
export function getOrderById(id) {
  return Request.get('apiB/order/get/' + id);
}

// 新建、修改订单数据
export function updateOrder(id, data) {
  return Request.post(`/order/${id ? 'edit' : 'add'}`, data);
}

// 删除订单数据
export function deleteOrder(id) {
  return Request.delete('/order/delete/' + id);
}


// 订单支付
export function payOrder(id, paymentData) {
  return Request.post(`apiB/order/pay/${id}`, paymentData);
}

// 获取订单金额
export function getOrderAmount(id) {
  return Request.get(`apiB/order/cost/${id}`);
}